<?php defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class DocarioViewEditgroup extends JView {
    function display($tpl=null) {
        $doc = JFactory::getDocument();
        $doc->addScript('components'.DS.'com_docario'.DS.'assets'.DS.'javascript'.DS.'groupform.js');
    
        JToolBarHelper::title(JText::_('EDIT_GROUP'));
        JToolBarHelper::save('savegroup');
        JToolBarHelper::back();
        
        $cid = JRequest::getVar('cid');
        $model = $this->getModel();
        
        $model->setId($cid);
        $group = $model->getGroup();
        
        if ($cid > 0)
            $members = $model->getMembers($group->id);
        
        $this->assignRef('group', $group);
        $this->assignRef('members', $members);
    
        parent::display($tpl);
    }
}
